{include file="public/layout" /}
<style type="text/css">
    a.link_names {
        background-color: #F5F5F5; border: none; margin: 0 10px 10px 0px;
    }
    a.link_active {
        background-color: rgb(51, 152, 204); border: none; margin: 0 10px 10px 0px; color: rgb(255, 255, 255);
    }
    a:hover.ncap-btn {
        text-decoration: none;
        color: rgb(255, 255, 255);
        background-color: rgb(51, 152, 204);
        border: none;
    }
    .layui-layer-btn {
        border-top: 1px solid #f0f0f0;
    }
</style>
<body class="bodystyle eyou_body_xin arctype">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>

<div class="sidebar-second order-navBox" style="min-height: calc(100%);height: unset;border-top: 1px solid #f0f0f0;">
    <ul id="accordion" class="accordion">
        <li>
            <ul class="submenu">
                {volist name="$linkGroup" id="vo"}
                    {if $vo.host_id == 1}
                        <li>
                            <a href='{:url("Other/link")}' {if condition="empty($ad_host_id) || $ad_host_id <= 2"} class="current" {/if}>商城链接</a>
                        </li>
                    {elseif $vo.host_id > 2 /}
                        <li>
                            <a href='{:url("Other/link", ["ad_host_id"=>$vo['host_id']])}' {if condition="$ad_host_id == $vo['host_id']"} class="current" {/if}>{$vo['host_title']}</a>
                        </li>
                    {/if}
                {/volist}
            </ul>
        </li>
    </ul>
</div>

<div id="page_div" class="page min-hg-c-i {if condition="$ad_host_id == 3"}mb10{else /}{/if}" style="min-height: calc(100% - 4px);min-width: auto;box-shadow: none;margin-left: 100px;">
    <div class="flexigrid">
        {if condition="$ad_host_id == 3"}
            {include file="other/link_product" /}
        {elseif condition="$ad_host_id == 4" /}
            {include file="other/link_arctype" /}
        {else /}
            {volist name="$linkGroup" key="i" id="vo"}
                {if condition="!in_array($vo.host_id, [3,4])"}
                    {gt name="$i" value="1"}<div>&nbsp;</div><div>&nbsp;</div>{/gt}
                    <span style="font-size: 14px;">{$vo['host_title']}</span>
                    <div class="mt10">
                        {volist name="$linkList[$vo['host_id']]" key="j" id="vo2"}
                        <a class="ncap-btn link_names {eq name="$vo2.link_id" value="$ad_link_id"}link_active{/eq}" data-id="{$vo2.link_id}" data-host_id="{$vo2.host_id}" data-names="{$vo2.link_names}" onclick="selectLink(this);">{$vo2.link_names}</a>
                        <textarea id="jsondata_{$vo2.link_id}" style="display: none;">{$vo2|json_encode=###}</textarea>
                        {/volist}
                    </div>
                {/if}
            {/volist}
        {/if}
    </div>
</div>
<input type="hidden" id="link_id" value="{$linkInfo['link_id']|default=''}">
<input type="hidden" id="host_id" value="{$linkInfo['host_id']|default=''}">
<input type="hidden" id="link_names" value="{$linkInfo['link_names']|default=''}">
<textarea id="link_jsondata" style="display: none;">{notempty name="$linkInfo['link_id']"}{$linkInfo|json_encode=###}{/notempty}</textarea>

<script type="text/javascript">
    function selectLink(obj) {
        var link_id = $(obj).attr('data-id');
        $('#link_id').val(link_id);
        $('#host_id').val($(obj).attr('data-host_id'));
        $('#link_names').val($(obj).attr('data-names'));
        $('#link_jsondata').val($('#jsondata_'+link_id).val());
        $('.link_names').removeClass('link_active');
        $(obj).addClass('link_active');
    }
</script>

{include file="public/footer" /}